function BookManager(layoutManager) {

	var self = this;
	this.activeBook = null;
	this.trManager = null;

	this.onBooksChange = function(books) {
		if(books.length == 0) {
			this.setBook(null);
		}
	};

	this.setBook = function(book) {
		if(this.activeBook != null && this.activeBook.equals(book)) {
			this.activeBook.reset();
		}
		this.activeBook = book;
		console.log('BookManager.setBook:');
		console.log(book);
		if(book != null) {
			book.load(function () {
				self.loadBook();
			});
		}
	};

	this.loadBook = function() {
		if(this.activeBook != null) {
			this.trManager = new TrManager();
			this.trManager.init(this.activeBook);
		}
	};
};